<script type="text/javascript" src="public/iScroll_4.2.5.js"></script>
<div class="pager_list" > 
  <div id="first" onclick="location.href='<?php echo $this->_var['pager']['page_first']; ?>' ; ">首页</div>
  <div id="prev" onclick="myScroll.scrollToPage('prev', 0);return false"></div>
  <div class="pager_num" id="pagers">
    <ul id="scroller" >
  <?php $_from = $this->_var['pager']['wap_page_number']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'page');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['page']):
?>
      <li onclick="location.href='<?php echo $this->_var['page']; ?>' ; "       <?php if ($this->_var['key'] == $this->_var['page_now']): ?> class="now"  <?php endif; ?> ><?php echo $this->_var['key']; ?></li>
  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>  
    </ul>
  </div>
  <div id="last" onclick="location.href='<?php echo $this->_var['pager']['page_last']; ?>' ; ">末页</div>
  <div id="next" onclick="myScroll.scrollToPage('next', 0);return false"></div>
  <script type="text/javascript">
  var length=$("#scroller li").length;
  var move_width=length*($("#scroller li").width()+14);
  $("#scroller").width(move_width);
  var num_width=$('.pager_list').width()-184;
  $("#pagers").width(num_width);
  var myScroll;
  function loaded() {
    myScroll = new iScroll('pagers', {
      snap: true,
      momentum: false,
      hScrollbar :false,
      vScroll : false,
      x: -<?php echo $this->_var['page_address']; ?>,
     });
  }
  document.addEventListener('DOMContentLoaded', loaded, false);
</script>
</div>